import React from 'react';
import { connect } from 'dva';
import {
  Form,Icon,Button, Drawer,
} from 'antd';
import UploadPage from './UploadPage'
function UserInfoPage({dispatch,form,DrawerVisible,username,vip} ){
 
  const { getFieldDecorator } = form;
 

 let onClose = () => {
    dispatch({
        type: 'indexpage/setState',
        payload: {
            DrawerVisible: false,
        }
    });
  };

  return (
    <div>
       
        <Drawer
          title="个人信息"
          placement="right"
          closable={false}
          onClose={onClose}
          visible={DrawerVisible}
          width ={450}
        >
          <p>
              点击上传头像
              <UploadPage/>
          </p>
          <p>用户名:{username}</p>
          <p>权限:{vip? "会员用户":"普通用户"}</p>
        </Drawer>
      </div>
  );
}
const UserInfoForm = Form.create({ name: 'normal_register' })(UserInfoPage);
export default connect(({ indexpage }) => ({ ...indexpage }))(UserInfoForm)
